/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bll.serviceimpl;


import com.alibaba.excel.EasyExcel;
import java.util.List;
import bll.service.StudentService;
import dal.dao.StudentDao;
import dal.daoimpl.StudentDaoImpl;
import dal.entity.Student;

/**
 *
 * @author a'a'a
 */
public class StudentServiceImpl implements StudentService
{
    
    private StudentDao studentDao;

    public StudentServiceImpl() {
        studentDao=new StudentDaoImpl();
    }
    
    

    @Override
    public boolean addStudent(Student student) {
        return studentDao.addStudent(student);
    }

    @Override
    public boolean updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }

    @Override
    public Student getStudentbyNum(String number) {
        return studentDao.getStudentbyNum(number);
    }

    @Override
    public List<Student> getAllStudent() {
        return studentDao.getAllStudent();
    }

    @Override
    public void toExcel(List<Student> students, String fileName) {
        EasyExcel.write(fileName,Student.class).sheet("Student").doWrite(students);
    }
    
}
